package com.example.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;


public class DatabaseHelper extends SQLiteOpenHelper{
	
	private String count = "create table zmyBill(id integer primary key autoincrement,username varchar(20),money varchar(20)," +
			"img varchar(20),type varchar(20),state varchar(20),time varchar(30),mark varchar(50),timeflag varchar(4))";
	private String user = "create table zmyUser(id integer primary key autoincrement,username varchar(20)," +
			"password varchar(20))";
	private String note = "create table zmyNote(id integer primary key autoincrement,title varchar(30),content varchar(80))";
	
	public DatabaseHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
	}


	public void onCreate(SQLiteDatabase db) {
		db.execSQL(count);
		db.execSQL(user);
		db.execSQL(note);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL(count);
		db.execSQL(user);
		db.execSQL(note);
	}

}
